﻿using com.iot.core.annotation;
using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using System.Xml.Linq;

namespace com.iot.core.data
{
    [Schema(Name = "树形类", Description = "")]
    public class TreeViewNode: BaseDto
    {


        [Comment("父编号")]
        [Schema(Name = "父编号", Description = "")]
        public long Pid { get; set; }


        [Comment("菜单代码")]
        [Schema(Name = "菜单代码", Description = "")]
        [MaxLength(50)]
        public string Code { get; set; } = "";


        [Comment("菜单名称")]
        [Schema(Name = "菜单名称", Description = "")]
        [Required(ErrorMessage = "{0}不能为空")]
        [MaxLength(50)]
        public string Name { get; set; } = "";


        [Comment("类型")]
        [Schema(Name = "类型", Description = "目录、菜单、权限")]
        [MaxLength(10)]
        public string Lx { get; set; } = "";


        [Comment("图标")]
        [Schema(Name = "图标", Description = "")]
        public string Imgurl { get; set; } = "";


        [Comment("参数1")]
        [Schema(Name = "参数1", Description = "")]
        [MaxLength(50)]
        public string P1 { get; set; } = "";


        [Comment("参数2")]
        [Schema(Name = "参数2", Description = "")]
        [MaxLength(50)]
        public string P2 { get; set; } = "";


        [Comment("参数3")]
        [Schema(Name = "参数3", Description = "")]
        [MaxLength(50)]
        public string P3 { get; set; } = "";


        [Comment("参数4")]
        [Schema(Name = "参数4", Description = "")]
        [MaxLength(50)]
        public string P4 { get; set; } = "";


        [Comment("Expanded")]
        [Schema(Name = "Expanded", Description = "")]
        public bool Expanded { get; set; }


        [Comment("HasChildren")]
        [Schema(Name = "HasChildren", Description = "")]
        public bool HasChildren { get; set; }


        [Comment("children")]
        [Schema(Name = "children", Description = "")]
        public List<TreeViewNode> Children { get; set; }=new List<TreeViewNode>();


        [Comment("Obj")]
        [Schema(Name = "Obj", Description = "")]
        public string Obj { get; set; } = "";

    }
}
